﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	UpGrade
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div class="full-content">
<% using (Html.BeginForm("upgrade", "register"))
   {
    %>
    <table width="400px">
        <tr>
            <td>
                <%=Html.RadioButton("upgrade","1",false) %>
            </td>
            
            <td><h1>1 Job / 30 Days</h1>
            </td>
            <td>
                $19.99
            </td>
        </tr>
        <tr>
            <td>
                <%=Html.RadioButton("upgrade", "2", false)%>
                
            </td>
            <td>
                <h1>10 Jobs /30 Days</h1>
            </td>
            <td>
               $99.99
            </td>
        </tr>
        <tr>
            <td>
                <%=Html.RadioButton("upgrade", "3", false)%>
                
            </td>
            <td>
                <h1>50 Jobs / 1 Year</h1>                
            </td>
            <td>
                $299.99
            </td>
        </tr>
        <tr>
            <td>
                <%=Html.RadioButton("upgrade", "4", false)%>
                
            </td>
            <td>
                <h1>Unlimited Jobs / 1 Year</h1>
            </td>
            <td>
                $499.99
            </td>
        </tr>
        <tr>
            <td>
                <%=Html.RadioButton("upgrade", "0", false)%>
                
            </td>
            <td>
                <h1>No Thanks.</h1>
            </td>
            <td>
                $0
            </td>
        </tr>
    </table>
<input type="submit" value="Next" id="Package" onclick="return  DoAjaxSubmit(this);"/>
 
   <script type="text/javascript">
       function DoAjaxSubmit(btnClicked) {
           var form = $(btnClicked).parents('form');
           $.ajax({
               type: "POST",
               url: form.attr('action'), //'<%=ResolveUrl("~/register/go") %>',
               data: form.serialize(),
               error: function (xhr, status, error) {
               },
               success: function (response) {
                   if (response != null) {
                       if (!response.Successful) {
                           alert("Please select the Upgrade Package.");
                           return false;
                       }
                       else {
                           window.location.href = "/Register/Confirmation";
                       }
                   }
               }
           });
           return false;
       }
    </script>
<%} %>
</div>

</asp:Content>
